<template>
    <h1>用户投资赎回</h1>

    <table>
        <tr>
            <td>项目名称</td>
            <td>{{ Info.I_Name }}</td>
        </tr>

        <tr>
            <td>项目总金额</td>
            <td>{{ Info.I_Budget }}</td>
        </tr>

        <tr>
            <td>用户已投金额</td>
            <td>{{ Info.UI_Money }}</td>
        </tr>

        <tr>
            <td>赎回金额</td>
            <td></td>
        </tr>

        <tr>
            <td colspan="2">
                <input type="submit" value="确认赎回">
            </td>
        </tr>
    </table>

</template>
<script setup lang="ts">

import { ref,onMounted } from 'vue';
import { useRoute } from 'vue-router';
import axios from 'axios';

const Info = ref({
    I_Budget:'',
    I_Name:'',
    UI_Money:''

})

const route = useRoute();

console.log(route.params.Id);

onMounted(()=>{
    UserInvestRedeem();
})

const UserInvestRedeem = ()=>{
    axios({
        method:'get',
        url:'http://localhost:63517/api/Invest/UserInvestRedeem',
        params:{
            Id:route.params.Id
        }
    })
    .then(res=>{
        console.log(res.data);
        Info.value = res.data[0]

    })
    .catch(err=>{
        console.log(err);
    })
}


</script>